<?php
/**
 * @package Spider Contacts
 * @author Web-Dorado
 * @copyright (C) 2012 Web-Dorado. All rights reserved.
 * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 **/
defined( '_JEXEC' ) or die( 'Restricted access' );

function spidercontactsBuildRoute(&$query)
{
	$segments = array();
	if (isset($query['view']))
	{
		$segments[] = $query['view'];
		unset($query['view']);
		if (isset($query['Itemid']))
		{
			$segments[] = $query['Itemid'];
			unset($query['Itemid']);
		}
	}
	return $segments;
}

function spidercontactsParseRoute($segments)
{
	$query = array();
	if (isset($segments[0]))
	{
		$query['view'] = $segments[0];
		if (isset($segments[1]))
		{
			$query['Itemid'] = $segments[1];
		}
	}
	return $query;
}
?>